#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
#endregion Using

namespace CY.GFive.Core.Business
{
	public class Asset : Business.BusinessBase<Asset, int>
	{
		#region Fields and Properties

		private Decimal totalValue = 0.0m;
		/// <summary>
		/// 
		/// </summary>
		public Decimal TotalValue
		{
			get { return totalValue; }
			set
			{
				if (value != totalValue)
				{
					MarkChanged("TotalValue");
					totalValue = value;
				}
			}
		}

		private int num = 0;
		/// <summary>
		/// 
		/// </summary>
		public int Num
		{
			get { return num; }
			set
			{
				if (value != num)
				{
					MarkChanged("Num");
					num = value;
				}
			}
		}

		private DateTime registerDate = DateTime.MinValue;
		/// <summary>
		/// 
		/// </summary>
		public DateTime RegisterDate
		{
			get { return registerDate; }
			set
			{
				if (value != registerDate)
				{
					MarkChanged("RegisterDate");
					registerDate = value;
				}
			}
		}

		private DateTime purchasingDate = DateTime.MinValue;
		/// <summary>
		/// 
		/// </summary>
		public DateTime PurchasingDate
		{
			get { return purchasingDate; }
			set
			{
				if (value != purchasingDate)
				{
					MarkChanged("PurchasingDate");
					purchasingDate = value;
				}
			}
		}

		private Decimal unitValue = 0.0m;
		/// <summary>
		/// 
		/// </summary>
		public Decimal UnitValue
		{
			get { return unitValue; }
			set
			{
				if (value != unitValue)
				{
					MarkChanged("UnitValue");
					unitValue = value;
				}
			}
		}

		private String assetItemName = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String AssetItemName
		{
			get { return assetItemName; }
			set
			{
				if (value != assetItemName)
				{
					MarkChanged("AssetItemName");
					assetItemName = value;
				}
			}
		}

		private String assetType = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String AssetType
		{
			get { return assetType; }
			set
			{
				if (value != assetType)
				{
					MarkChanged("AssetType");
					assetType = value;
				}
			}
		}

		#endregion Fields and Properties

		#region Constructors

		public Asset()
		{
		}

		#endregion Constructors

		#region Base overrides

		protected override void ValidationRules()
		{
		}

		protected override Asset DataSelect(int id)
		{
			return Services.DALService.AssetService.Select(id);
		}

		protected override void DataUpdate()
		{
			Services.DALService.AssetService.Update(this);
		}

		protected override void DataInsert()
		{
			Services.DALService.AssetService.Insert(this);
		}

		protected override void DataDelete()
		{
			Services.DALService.AssetService.Delete(this);
		}

		#endregion Base overrides
	}
}
